Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
phosphor-menus
Advanced tools
Phosphor widgets for creating menus and menu bars.
Prerequisites
npm install --save phosphor-menus
Prerequisites
git clone https://github.com/phosphorjs/phosphor-menus.git
cd phosphor-menus
npm install
Rebuild
npm run clean
npm run build
Follow the source build instructions first.
# run tests in Firefox
npm test
# run tests in Chrome
npm run test:chrome
# run tests in IE
npm run test:ie
Follow the source build instructions first.
npm run docs
Navigate to docs/index.html
.
The runtime versions which are currently known to work are listed below. Earlier versions may also work, but come with no guarantees.
Follow the package install instructions first.
npm install --save-dev browserify browserify-css
browserify myapp.js -o mybundle.js
Note: This module is fully compatible with Node/Babel/ES6/ES5. Simply omit the type declarations when using a language other than TypeScript.
import {
Menu, MenuBar, MenuItem
} from 'phosphor-menus';
function main(): void {
let logHandler = (item: MenuItem) => {
console.log(item.text);
};
let fileMenu = new Menu([
new MenuItem({
text: 'New File',
shortcut: 'Ctrl+N',
handler: logHandler
}),
new MenuItem({
text: 'Open File',
shortcut: 'Ctrl+O',
handler: logHandler
}),
new MenuItem({
text: 'Save As...',
shortcut: 'Ctrl+Shift+S',
handler: logHandler
}),
new MenuItem({
type: MenuItem.Separator
}),
new MenuItem({
text: 'Exit',
handler: logHandler
})
]);
let editMenu = new Menu([
new MenuItem({
text: '&Undo',
icon: 'fa fa-undo',
shortcut: 'Ctrl+Z',
handler: logHandler
}),
new MenuItem({
text: '&Repeat',
icon: 'fa fa-repeat',
shortcut: 'Ctrl+Y',
handler: logHandler
}),
new MenuItem({
type: MenuItem.Separator
}),
new MenuItem({
text: '&Copy',
icon: 'fa fa-copy',
shortcut: 'Ctrl+C',
handler: logHandler
}),
new MenuItem({
text: 'Cu&t',
icon: 'fa fa-cut',
shortcut: 'Ctrl+X',
handler: logHandler
}),
new MenuItem({
text: '&Paste',
icon: 'fa fa-paste',
shortcut: 'Ctrl+V',
handler: logHandler
})
]);
let contextMenu = new Menu([
new MenuItem({
text: '&Copy',
icon: 'fa fa-copy',
shortcut: 'Ctrl+C',
handler: logHandler
}),
new MenuItem({
text: 'Cu&t',
icon: 'fa fa-cut',
shortcut: 'Ctrl+X',
handler: logHandler
}),
new MenuItem({
text: '&Paste',
icon: 'fa fa-paste',
shortcut: 'Ctrl+V',
handler: logHandler
})
]);
let menuBar = new MenuBar([
new MenuItem({
text: 'File',
submenu: fileMenu
}),
new MenuItem({
text: 'Edit',
submenu: editMenu
})
]);
menuBar.attach(document.body);
document.addEventListener('contextmenu', (event: MouseEvent) => {
event.preventDefault();
let x = event.clientX;
let y = event.clientY;
contextMenu.popup(x, y);
});
}
FAQs
Phosphor widgets for creating menus and menu bars.
The npm package phosphor-menus receives a total of 12 weekly downloads. As such, phosphor-menus popularity was classified as not popular.
We found that phosphor-menus demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.